package com.nhjf.common.util.tools;

import java.util.Date;

import org.apache.log4j.Logger;

public class LogMessage { 

	static Logger logger = Logger.getLogger("logfile");

	public static String getOptionLogs(Long optionId, String data) {
		StringBuffer info = new StringBuffer();
		info.append("操作人ID:").append(optionId);
		info.append("  ");
		info.append("操作时间:").append(StringUtil.getFormatDate(new Date()));
		info.append("  ");
		info.append("数据:" + data);
		info.append(" > ");
		return info.toString();
	}

	public static String getLogs(Long optionId) {
		StringBuffer info = new StringBuffer();
		info.append("操作人ID:").append(optionId);
		info.append("  ");
		info.append("操作时间:").append(StringUtil.getFormatDate(new Date()));
		info.append(" > ");
		return info.toString();
	}

	/**
	 * log4j写日志
	 * 
	 * @param log
	 */
	public static void logwrite(Class clazz, String log) {
		logger.info(clazz.getCanonicalName()+":"+log);
	}
}

